#include"mylist.h"

namespace baka
{
	void list_test01()
	{
		mylist<int> l1;
		mylist<int> l2(3);
		mylist<int> l3(5,1);
		mylist<int> l4(l3.begin(), l3.end());
		mylist<int> l5(l3);
		print_list(l3);
		l1 = l3;
		l3 = l2;
		print_list(l3);
	}

	void list_test02()
	{
		mylist<int> l3(5, 1);
		cout << l3.front() << endl;
		cout << l3.back() << endl;
		mylist<int> l1;

	}

	void list_test04()
	{
		mylist<int> l1;
		mylist<int> l2;
		l1.push_back(2);
		l1.push_back(2);
		l1.push_back(2);
		print_list(l1);
		l1.push_front(3);
		l1.push_front(3);
		l1.push_front(3);
		print_list(l1);
		l1.pop_back();
		l1.pop_back();
		print_list(l1);
		l1.pop_front();
		l1.pop_front();
		print_list(l1);
		cout << l1.size() << endl;
		cout << l1.empty() << endl;
		cout << l2.empty() << endl;
	}
	void list_test05()
	{
		mylist<int> l1;
		l1.push_back(1);
		l1.push_back(2);
		l1.push_back(3);
		l1.push_back(4);
		l1.push_back(5);
		l1.insert(l1.begin(), 9);
		l1.insert(l1.begin()++, 9);
		l1.insert(l1.end(), 9);
		print_list(l1);

		l1.erase(l1.begin());
		l1.erase(--l1.end());
		print_list(l1);
		
		mylist<int>::iterator it = l1.begin();
		for (int i = 0; i < 3; i++)
		{
			++it;
		}
		l1.erase(it);
		print_list(l1);


	}
}



int main()
{
	baka::list_test01();
	return 0;
}